<%--
  Created by IntelliJ IDEA.
  User: dell
  Date: 2021/12/1
  Time: 20:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="static/js/jquery-3.6.0.js"></script>
    <script>
        function a1(){
            $.post("${pageContext.request.contextPath}/a3",{"name":$("#username").val()},function (data){
                if (data.toString()==="OK")
                    $("#con1").css("color","green");
                else $("#con1").css("color","red");
                $("#con1").html(data);
            })
        }
        function a2() {
            $.post("${pageContext.request.contextPath}/a3",{"pwd":$("#pwd").val()},function (data){
                if (data.toString()==="OK")
                    $("#con2").css({"color":"green"});
                else $("#con2").css({"color":"red","font-weight":"bold"});
                $("#con2").html(data);
            })
        }
    </script>
</head>
<body>
<div><input type="text"  id="username" onblur="a1()"><span id="con1"></span></div>
<div><input type="text"  id="pwd" onblur="a2()"><span id="con2"></span></div>
</body>
</html>
